//
//  DeviceHandle.h
//  SenMo
//
//  Created by ZengYuan on 15/12/16.
//  Copyright © 2015年 ZengYuan. All rights reserved.
//

#import <Foundation/Foundation.h>



@interface DeviceHandle : NSObject

/**
 *  设备管理员重新录入设备的用户密码等信息
 *
 *  @param device          设备号
 *  @param device_username 设备用户名
 *  @param device_pass     设备密码
 *  @param success         成功
 *  @param failure         失败
 */
+(void)deviceSetNewAdmi:(NSString *)device device_username:(NSString *)device_username  device_pass:(NSString *)device_pass
                success:(void (^)())success failure:(void (^)(NSString *error))failure;

+(void)deviceBind:(NSString *)device device_username:(NSString *)device_username  device_pass:(NSString *)device_pass
          success:(void (^)())success failure:(void (^)(NSString *error))failure;


/**
 *  绑定设备(主要检查用)
 *
 *  @param device  设备号
 *  @param result  结果
 *  @param failure 失败
 */

+(void)deviceBind:(NSString *)device
           result:(void (^)(NSInteger sta))result failure:(void (^)(NSString *error))failure;

+(void)deviceUnbind:(NSString *)device
            success:(void (^)())success failure:(void (^)(NSString *error))failure;

/**
 *  设备分享
 *
 *  @param device  设备号
 *  @param user_id 用户id
 *  @param success 成功
 *  @param failure 失败
 */
+(void)deviceShare:(NSString *)device userid:(NSString *)user_id
           success:(void (^)())success failure:(void (^)(NSString *error))failure;


/**
 *  同意设备分享请求 （管理员）
 *
 *  @param device_id   设备id
 *  @param user_id     用户id
 *  @param success     成功
 *  @param failure     失败
 */
+(void)deviceAcceptSharerRequest:(NSString *)device_id
                         userid:(NSString *)user_id
             success:(void (^)())success failure:(void (^)(NSString *error))failure;


/**
 *  取消分享(管理员有效)
 *
 *  @param devices 设备id 数组
 *  @param user_id 用户id
 *  @param success 成功
 *  @param failure 失败
 */
+(void)deviceunShare:(NSString *)device_id userid:(NSArray *)useridArray
             success:(void (^)())success failure:(void (^)(NSString *error))failure;



/**
 *  检查设备是否可看
 *
 *  @param device_id 设备id
 *  @param _result   结果
 */

+(void)deviceAvailble:(NSString *)device_id
               result:(void (^)(BOOL availble))_result;

/**
 *  设备管理权移交（管理员）
 *
 *  @param device_id 设备id
 *  @param user_id   用户id
 *  @param success   成功
 *  @param failure   失败
 */

+(void)deviceAdminTransfer:(NSString *)device_id
                    userid:(NSString *)user_id
                   success:(void (^)())success failure:(void (^)(NSString *error))failure;



/**
 *  设置播放时间段（管理员有效）
 *
 *  @param device_id  设备id
 *  @param start_time 起始时间
 *  @param end_time   结束时间
 *  @param success    成功
 *  @param failure    失败
 */
+(void)deviceSetTimeInterval:(NSString *)device_id
                  start_time:(NSString *)start_time
                  end_time:(NSString *)end_time
                     success:(void (^)())success failure:(void (^)(NSString *error))failure;

/**
 *  获取播放时间段（管理员有效）
 *
 *  @param device_id 设备id
 *  @param success   成功
 *  @param failure   失败
 */
+(void)deviceGetTimeInterval:(NSString *)device_id
                     success:(void (^)(NSString *start_time, NSString *end_time))success
                     failure:(void (^)(NSString *error))failure;

/**
 *  获取设备请求消息（管理员有效）
 *
 *  @param device_id 设备id
 *  @param success   成功
 *  @param failure   失败
 */
+(void)deviceGetAllRequest:(NSString *)device_id
                     success:(void (^)())success
                     failure:(void (^)(NSString *error))failure;
//修改设备名称
+(void)deviceChangeName:(NSString *)newName deviceId:(NSString *)device_id
                success:(void (^)())success
                failure:(void (^)(NSString *error))failure;

//修改通道名称
+(void)channelChangeName:(NSString *)newName deviceId:(NSString *)device_id
       device_channel_no:(NSInteger)device_channel_no
                 success:(void (^)())success
                 failure:(void (^)(NSString *error))failure;


@end
